<%@ page contentType="text/html; charset=UTF-8"%>
<%@ taglib prefix="s" uri="/struts-tags"%>
<html>
<head>
	<style>
		body, input{
			font-family: Calibri, Arial;
		}
		table#contact {
			border-collapse: collapse;
			width:550px;
		}
		th {
			height: 40px;
			background-color: #ffee55;
		}
	</style>
	<title>Utente Manager - Project Live!</title>
</head>
<body>
	<h1>Inserimento Utente</h1>
	<s:actionerror/>

	<s:form action="addUtente" method="post">
		<s:textfield name="utente.nome" label="Username"/>
		<s:textfield name="utente.descrizione" label="Password"/>		
		<s:submit value="Add Utente" align="center"/>
	</s:form>


	<h2>Utente</h2>
	<table id="utente" border="1">
		<tr>
			<th>Username</th>
			<th>Password</th>
		</tr>
		<s:iterator value="utenti">
		<tr>
			<td><s:property value="username"/></td>
			<td><s:property value="password"/></td>	
			<td>
				 <s:form theme="simple">			        
			        <s:submit action="deleteUtente" value="Remove" onclick="return confirm('Are you sure you want to delete this item?');"/>
			        <s:submit action="displayEdit" value="Edit"/>
			        <s:hidden name="id" value="%{id}"/>
			    </s:form>
			</td>
		</tr>	
		</s:iterator>
	</table>
</body>
</html>